<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterCart extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('cart', function (Blueprint $table) {
            $table->unsignedInteger('product_id');
            $table->string('product_title')->comment('商品标题');
            $table->string('product_image')->comment('商品图片');
            $table->string('spec_sku_name')->comment('商品规格名称');
            $table->boolean('on_sale')->default(1)->comment('是否失效 1正常,0失效');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('cart', function (Blueprint $table) {
            $table->dropColumn('on_sale');
            $table->dropColumn('product_id');
            $table->dropColumn('product_title');
            $table->dropColumn('product_image');
            $table->dropColumn('spec_sku_name');
        });
    }
}
